home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-14 | 2.6 KB | 101 lines | [TEXT/MPS ] |
- /* _________________________________________________________________________________________________________ //
- Copyright © 1992-93 Apple Computer, Inc. All rights reserved.
- Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
- Programmer: Kent Sandvik
- Date: Saturday, June 6, 1992 19:18:58
- Revision comments are at the end of this file.
- ---
- TToolbox is a Toolbox utility class, used for initialization and Toolbox functions.
- TToolbox.cp contains the class body information for the TToolbox member functions.
- _________________________________________________________________________________________________________ */
-
-
- // Include files
- #ifndef _TOOLBOX_
- #include "Toolbox.h"
- #endif
-
-
- // _________________________________________________________________________________________________________ //
- // TToolbox class member function implementations
- // CONSTRUCTORS & DESTRUCTORS
- #pragma segment Toolbox
- TToolbox::TToolbox()
- // Default constructor.
- {
- }
-
-
- #pragma segment Toolbox
- TToolbox::~TToolbox()
- // Virtual destructor, we are not doing anything inside this one just now, note
- // that virtual destructors should not be inlined
- {
- }
-
-
- // INITIATION ROUTINES
- #pragma segment Toolbox
- void TToolbox::InitializeToolbox()
- // Initialize the Macintosh Toolbox environment, standard initialization routines.
- {
- ::InitGraf(&qd.thePort);
- ::InitFonts();
- ::InitWindows();
- ::InitMenus();
- ::TEInit();
- ::InitDialogs(NULL);
- ::InitCursor();
- }
-
-
- // MAIN INTERFACE
- #pragma segment Toolbox
- void TToolbox::PullApplicationToFront(short nCount)
- // Make sure that any possible splash screens are placed front-most.
- {
- EventRecord anEvent;
- short aCount;
-
- for (aCount = 1; aCount <= nCount; aCount++) // pluck out a couple of events until things are OK
- ::EventAvail(everyEvent, &anEvent);
- }
-
-
- #pragma segment Toolbox
- Boolean TToolbox::CreateMasterPointers(short nMasterPtr)
- // Create n amount of Master Pointers.
- {
- OSErr anErr;
-
- while (nMasterPtr--)
- ::MoreMasters();
-
- anErr = MemError();
- VASSERT(anErr == noErr, ("Problems with MoreMasters = %d", anErr));
-
- if(anErr == noErr)
- return true;
- else
- return false; // we had problems, and signal this
- }
-
-
- #pragma segment Toolbox
- void TToolbox::Initialize()
- // Default initialization of Toolbox routines.
- {
- this->InitializeToolbox();
- this->CreateMasterPointers();
- this->PullApplicationToFront();
- }
-
-
- // _________________________________________________________________________________________________________ //
-
- /* Change History (most recent last):
- No Init. Date Comment
- 1 khs 6/6/92 New file
- 2 khs 1/3/93 Cleanup
- */
-